package com.lwz.repair.sendredpackage;

import java.util.ArrayList;
import java.util.Random;

public class Member extends User{
    public Member() {
    }

    public Member(String name, int monkny) {
        super(name, monkny);
    }

    public void recivered(ArrayList<Integer> redlist){
        System.out.println("redlist = " + redlist.size());
        int index = new Random().nextInt(redlist.size());

        int monky =redlist.remove(index);

        int leftmonky =super.getMonkny();


        super.setMonkny(monky+leftmonky);


    }

}
